Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 3 - Geometric Styles / Geometric Styles Reference
Functions / Getting and Setting Patterns


GXGetShapePattern

You can use the GXGetShapePattern function to retrieve the pattern information from the style object associated with a particular shape.

gxPatternRecord *GXGetShapePattern(gxShape source, 
                                   gxPatternRecord *pattern);
source
The shape whose pattern information you want to retrieve.
pattern
A pointer to a gxPatternRecord structure. On return, this structure contains the pattern information for the source shape.
function result
A copy of the gxPatternRecord structure associated with the
source shape's style object.
DESCRIPTION
The GXGetShapePattern function returns as its function result and in the pattern parameter a pointer to a gxPatternRecord structure containing the pattern information for the style object of the shape specified by the source parameter.

This function creates a new shape to encapsulate the pattern geometry, and places a reference to this shape in the pattern field of the returned gxPatternRecord structure. You should dispose of this shape when you no longer need it.

Since this function copies the pattern information from the source shape's style, you may make changes to the gxPatternRecord structure returned by this function without affecting the source shape's pattern. If you want to change the pattern information for the source shape, you must use the GXSetShapePattern function.

SPECIAL CONSIDERATIONS
The GXGetShapePattern function may create a shape; you are responsible for disposing of this shape when you no longer need it. See Inside Macintosh: QuickDraw GX Objects for information about creating and disposing of objects.

ERRORS, WARNINGS, AND NOTICES
Errors
out_of_memory
shape_is_nil
parameter_is_nil
SEE ALSO
For a discussion of patterns, see "Patterns" on page 3-31.

For examples of adding patterns to shapes, see page 3-86 through page 3-91.

For a discussion of the gxPatternRecord structure and a description of what types of shapes you can use as pattern shapes, see "The Pattern Structure" on page 3-106.

To retrieve pattern information from a style object, use the GXGetStylePattern function, which is described on page 3-142. To specify pattern information for a style object, use the GXSetStylePattern function, which is described on page 3-144.

To specify pattern information for a style object associated with a particular shape, use the GXSetShapePattern function, which is described in the next section.

To determine where pattern shapes are drawn for a particular shape, use the GXGetShapePatternPositions function, which is described on page 3-147.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help